package com.example.mobile2030606148tdh0615hw;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class MySQLiteOpenHelper extends SQLiteOpenHelper {
    public MySQLiteOpenHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String CarPeccancy="create table car(_id integer primary key autoincrement,id integer,carnumber text,pcode,text,pdatetime text,paddr text)";
        db.execSQL(CarPeccancy);
        String Sense="create table sen(_id integer primary key autoincrement,id integer,Co2 integer,Pm25 integer,Lightintensity integer,humidity integer,temperature integer)";
        db.execSQL(Sense);
        String CarInfor = "create table carinfor(_id integer primary key autoincrement,id integer,carnumber text,number text,pcardid text,buydata text,carbrand text)";
        db.execSQL(CarInfor);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
